﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="baocaoxuatnhapton.ascx.cs" Inherits="WebUserControl_baocaoxuatnhapton" %>
<%@ Register src="uscMsgBox.ascx" tagname="uscMsgBox" tagprefix="uc1" %>
<%@ Register src="uscTitleForm.ascx" tagname="uscTitleForm" tagprefix="uc2" %>
<%@ Register assembly="DevExpress.Web.ASPxPivotGrid.v9.2, Version=9.2.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" namespace="DevExpress.Web.ASPxPivotGrid" tagprefix="dxwpg" %>
<%@ Register assembly="DevExpress.Web.ASPxPivotGrid.v9.2.Export, Version=9.2.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" namespace="DevExpress.XtraPivotGrid.Web" tagprefix="dxpgw" %>

<link rel="stylesheet" href='<%=ResolveUrl("~/LayoutCss/datePicker.css")%>' type="text/css" />
<link rel="stylesheet" href='<%=ResolveUrl("~/LayoutCss/K_BaoCaoFormLayout.css")%>' type="text/css" />

<script type="text/javascript">
     function pageLoad() {

       
     
       $("#<%= Button1.ClientID %>").click(function() { 
        $.blockUI({
             message: '<h1>Xin vui lòng chờ xử lý</h1>', 
            css: { 
            border: 'none', 
            padding: '15px', 
            backgroundColor: '#f00', 
            opacity: .5, 
            color: '#fff' 
        } }); 
        }); 
       $("#<%= Button2.ClientID %>").click(function() { 
        $.blockUI({
             message: '<h1>Xin vui lòng chờ xử lý</h1>', 
            css: { 
            border: 'none', 
            padding: '15px', 
            backgroundColor: '#f00', 
            opacity: .5, 
            color: '#fff'
        }
    });
    setTimeout($.unblockUI, 7000); 
        }); 
       
       
        Sys.WebForms.PageRequestManager.getInstance().add_endRequest(EndRequestHandler);
                function EndRequestHandler(sender, args) {
                        $.unblockUI();
                }
        }  
   
</script>
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<Triggers>
<asp:PostBackTrigger ControlID="Button2" />
</Triggers>
    <ContentTemplate>
     <fieldset>
    <legend>Báo cáo xuất nhập tồn</legend>
    <div class="fm-req">
      <label for="dr_TTPP">TTPP:</label>
       <asp:DropDownList ID="dr_TTPP" runat="server" Width="150px" AutoPostBack="True" 
                onselectedindexchanged="dr_TTPP_SelectedIndexChanged">
            </asp:DropDownList>
      </div>
      <div class="fm-req">
      <asp:Label ID="Label4" runat="server" Text="Label"></asp:Label>
      </div>
       <div class="fm-req">
       <label for="txt_tungay">Từ ngày:</label>
      <asp:TextBox ID="txt_tungay" runat="server"></asp:TextBox>
       </div>
        <div class="fm-req">
       <label for="txt_denngay">Đến ngày:</label>
       <asp:TextBox ID="txt_denngay" runat="server" 
                ontextchanged="txt_denngay_TextChanged" AutoPostBack="True"></asp:TextBox>
       </div>
      </fieldset>  
      <div>
       <asp:Button ID="Button1" runat="server" onclick="Button1_Click" 
                Text="Báo cáo" />
            &nbsp;&nbsp;
            <asp:Button ID="Button2" runat="server" onclick="Button2_Click1" 
                Text="Export to excel" />
      </div>

       <br />
            <dxwpg:ASPxPivotGrid ID="ASPxPivotGrid1" runat="server">
                <Fields>
                    <dxwpg:PivotGridField ID="field" Area="FilterArea" AreaIndex="0" 
                        Caption="Trung tâm PP" FieldName="SiteCode">
                    </dxwpg:PivotGridField>
                    <dxwpg:PivotGridField ID="field1" Area="FilterArea" AreaIndex="1" Caption="Kho" 
                        FieldName="WhseCode" Visible="False">
                    </dxwpg:PivotGridField>
                    <dxwpg:PivotGridField ID="field2" Area="RowArea" AreaIndex="0" 
                        Caption="Mã hàng" FieldName="SkuCode">
                    </dxwpg:PivotGridField>
                    <dxwpg:PivotGridField ID="field3" Area="DataArea" AreaIndex="7" 
                        Caption="Tồn cuối" CellFormat-FormatType="Numeric" FieldName="toncuoi">
                    </dxwpg:PivotGridField>
                    <dxwpg:PivotGridField ID="field4" Area="DataArea" AreaIndex="1" 
                        Caption="nhập hàng từ chi nhánh" CellFormat-FormatType="Numeric" 
                        FieldName="nhaphangtuchinhanh">
                    </dxwpg:PivotGridField>
                    <dxwpg:PivotGridField ID="field5" Area="DataArea" AreaIndex="2" 
                        Caption="Xuất hàng sang chi nhánh" CellFormat-FormatType="Numeric" 
                        FieldName="xuathangsangchinhanh">
                    </dxwpg:PivotGridField>
                    <dxwpg:PivotGridField ID="field6" Area="DataArea" AreaIndex="3" 
                        Caption="Bán hàng" CellFormat-FormatType="Numeric" FieldName="banhang">
                    </dxwpg:PivotGridField>
                    <dxwpg:PivotGridField ID="field7" Area="DataArea" AreaIndex="4" 
                        Caption="Trả hàng" CellFormat-FormatType="Numeric" FieldName="trahang">
                    </dxwpg:PivotGridField>
                    <dxwpg:PivotGridField ID="field8" Area="DataArea" AreaIndex="5" 
                        Caption="Nhập KM" CellFormat-FormatType="Numeric" FieldName="nhapkhuyenmai">
                    </dxwpg:PivotGridField>
                    <dxwpg:PivotGridField ID="field9" Area="DataArea" AreaIndex="6" 
                        Caption="Xuất KM" CellFormat-FormatType="Numeric" FieldName="xuatkhuyenmai">
                    </dxwpg:PivotGridField>
                    <dxwpg:PivotGridField ID="field10" Area="DataArea" AreaIndex="0" 
                        Caption="Tồn đầu" CellFormat-FormatType="Numeric" FieldName="tondau">
                    </dxwpg:PivotGridField>
                    <dxwpg:PivotGridField ID="field11" Area="RowArea" AreaIndex="1" 
                        Caption="Tên hàng" FieldName="TenHang">
                    </dxwpg:PivotGridField>
                    <dxwpg:PivotGridField ID="field12" Area="FilterArea" AreaIndex="1" 
                        Caption="Ngành hàng" FieldName="NganhHang">
                    </dxwpg:PivotGridField>
                    <dxwpg:PivotGridField ID="field13" Area="FilterArea" AreaIndex="2" 
                        Caption="Nhãn hiệu" FieldName="NhanHieu">
                    </dxwpg:PivotGridField>
                    <dxwpg:PivotGridField ID="field14" Area="FilterArea" AreaIndex="3" 
                        Caption="Sản phẩm" FieldName="SanPham">
                    </dxwpg:PivotGridField>
                </Fields>
                <OptionsView ShowDataHeaders="False" />
            </dxwpg:ASPxPivotGrid>
        

        <uc1:uscMsgBox ID="uscMsgBox1" runat="server" />
<dxpgw:ASPxPivotGridExporter ID="ASPxPivotGridExporter1" runat="server" 
    ASPxPivotGridID="ASPxPivotGrid1">
</dxpgw:ASPxPivotGridExporter>
    </ContentTemplate>
</asp:UpdatePanel>




